#ifndef _LIDAR_PREPROCESS_TYPE_H_
#define _LIDAR_PREPROCESS_TYPE_H_
#include <vector>
namespace perception
{
    namespace lidar_preprocess
    {

        struct car_config
        {
            float car_xmax;
            float car_xmin;
            float car_ymax;
            float car_ymin;
            float car_zmax;
            float car_zmin;
            void reset()
            {
                car_xmax = 1.0;
                car_xmin = -5.0;
                car_ymax = 2.0;
                car_ymin = -2.0;
                car_zmax = 2.0;
                car_zmin = -2.0;
            }
        };
        struct lidar_config
        {
            float xmax;
            float xmin;
            float ymax;
            float ymin;
            float zmax;
            float zmin;
            void reset()
            {
                xmax = 40.0;
                xmin = -20.0;
                ymax = 15.0;
                ymin = -15.0;
                zmax = 2.0;
                zmin = -2.0;
            }
        };

        struct condition_filter_config
        {
            car_config car_config_;
            lidar_config lidar_config_;
            bool OrAnd;
            void reset()
            {
                car_config_.reset();
                lidar_config_.reset();
                OrAnd = true;
            }
        };
        struct radius_filter_config
        {
            float radius_search;
            int search_num;
            void reset()
            {
                radius_search = 1;
                search_num = 5;
            }
        };
        struct voxel_filter_config
        {
            float voxel_size;
            void reset()
            {
                voxel_size = 0.1;
            }
        };
        struct average_seg_config
        {
            float grid_gradient_eps;
            float ground_height;
            float cell_size_x;
            float cell_size_y;
            float threshold_h;
            float xmax;
            float xmin;
            float ymax;
            float ymin;
            int points_num;
            int search_scope;
            bool get_ground_points;
            void reset()
            {
                search_scope = 2;
                grid_gradient_eps = 0.1;
                ground_height = -0.5;
                xmax = 40.0;
                xmin = -20.0;
                ymax = 15.0;
                ymin = -15.0;
                cell_size_x = 0.5;
                cell_size_y = 0.5;
                threshold_h = 0.2;
                points_num = 5;
                get_ground_points = false;
            }
        };
        struct multi_process_points_config
        {
            int one_points_max_num; // 每份最大的点云数量
            int one_points_min_num; // 每份最小的点云数量
            int max_thread_num;     // 最大线程数
            void reset()
            {
                one_points_max_num = 20000;
                one_points_min_num = 5000;
                max_thread_num = 16;
            }
        };

        struct config
        {
            car_config car_config_;
            lidar_config lidar_config_;
            condition_filter_config condition_filter_config_;
            radius_filter_config radius_filter_config_;
            voxel_filter_config voxel_filter_config_;
            average_seg_config average_seg_config_;
            multi_process_points_config multi_process_points_config_;
            int master_sys_time_eps = 200;  // 主雷达与系统的时间差，用于判断是否点云已经丢失
            int master_slave_time_eps = 60; // 主从雷达的时间差，用于融合点云
            int method = 1;                 // 1- 平均地面分割 2-patchwork
            void reset()
            {
                car_config_.reset();
                lidar_config_.reset();
                condition_filter_config_.reset();
                radius_filter_config_.reset();
                voxel_filter_config_.reset();
                average_seg_config_.reset();
                multi_process_points_config_.reset();
            }
        };
    }
}
#endif